package vip.youngboy.longpoll.rest;

import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Controller;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.util.HtmlUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Iterator;
import java.util.Map;

@Controller
public class LoginRest {

    private Boolean formLoginEnabled = true;

    private Boolean oauth2LoginEnabled = true;

    private String usernameParameter;

    private String url;


    @RequestMapping("/login")
    public String loginPage() {

        return "login";
    }


    @PostMapping("/loginVerify")
    public String loginVerify(MultiValueMap<String, String> formData) {
        //关键是code
        //TODO 登陆成功返回啥?  带上code和state重定向到第三方客户端回调页面？
        return "";
    }


}
